/*
 *------------------------------------------------------------------------------
 * @File      :    mai_sys.h
 * @Date      :    2021-4-8
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MADP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */


#ifndef __MAI_SYS_H__
#define __MAI_SYS_H__

#include <stdio.h>

#include "ei_common.h"
#include "ei_defines.h"
#include "mai_log.h"

#ifdef MADP_TRACE

#define SYS_TRACE(level, enModId, ...)\
    MADP_TRACE(level, __VA_ARGS__) \

#else

#define SYS_TRACE(level, enModId, fmt...)\
    do{ \
     printf("[Func]:%s [Line]:%d [Info]:", __FUNCTION__, __LINE__);\
     printf(level, enModId, ##fmt);\
    }while(0)

#endif

#define CHECK_MAPI_SYS_NULL_PTR(paraname,ptr)\
    do{\
        if(NULL == ptr)\
        {\
            SYS_TRACE(MADP_EN_ERR_LEVEL_ERROR,EI_MADP_MOD_SYS,"%s is NULL pointer\n",paraname);\
            return EI_MAI_ERR_SYS_NULL_PTR;\
        }\
    }while(0)


#endif

